# -*- coding:utf-8 -*-
# @FileName  :utils.py
# @Time      :2020/10/25 14:59
# @Author    :zhoujirong

from common.http_request import Request
from biz.support.urls import ServerUrl

class PerCreditUserRequest:
    '''个人征信用户相关接口'''
    @classmethod
    def per_create(cls,creditName,creditUser,creditOrgCode,creditPassword,deptCode,
                   userClass,digitalCertificate,userType,remarks,userStatus,cookie):
        '''
        添加
        :param creditName:
        :param creditUser:
        :param creditOrgCode:
        :param creditPassword:
        :param deptCode:
        :param userClass:
        :param digitalCertificate:
        :param userType:
        :param remarks:
        :param userStatus:
        :param cookie:
        :return:
        '''
        data = {
            'creditName': creditName,
            'creditUser': creditUser,
            'creditOrgCode': creditOrgCode,
            'creditPassword': creditPassword,
            'deptCode': deptCode,
            'userClass': userClass,
            'digitalCertificate': digitalCertificate,
            'userType': userType,
            'remarks': remarks,
            'userStatus': userStatus
        }
        req = Request(ServerUrl.credit_per_user_create_url, data=data,headers=cookie)
        return req.post()
    @classmethod
    def per_getpage(cls,curPage,maxSize,search_LIKE_creditName,search_LIKE_creditUser,
                    search_LIKE_creditOrgCode,search_EQ_userClass,search_IN_deptCode,
                    search_EQ_userStatus,cookie):
        '''
        检索
        :param curPage:
        :param maxSize:
        :param search_LIKE_creditName:
        :param search_LIKE_creditUser:
        :param search_LIKE_creditOrgCode:
        :param search_EQ_userClass:
        :param search_IN_deptCode:
        :param search_EQ_userStatus:
        :param cookie:
        :return:
        '''
        data = {
        'curPage':curPage,
        'maxSize':maxSize,
        'search_LIKE_creditName':search_LIKE_creditName,
        'search_LIKE_creditUser':search_LIKE_creditUser,
        'search_LIKE_creditOrgCode':search_LIKE_creditOrgCode,
        'search_EQ_userClass':search_EQ_userClass,
        'search_IN_deptCode':search_IN_deptCode,
        'search_EQ_userStatus':search_EQ_userStatus
                }
        req = Request(ServerUrl.credit_per_user_getpage_url,params=data,headers=cookie)
        return req.get()

    @classmethod
    def per_detail(cls,id,cookie):
        data = {
            'id':id
        }
        req = Request(ServerUrl.credit_per_detail_url,data=data,headers=cookie)
        return req.post()

    @classmethod
    def per_update(cls,createDate,
                        createUser,
                        creditName,
                        creditOrgCode,
                        creditPassword,
                        creditUser,
                        deptCode,
                        digitalCertificate,
                        ext1,
                        ext2,
                        ext3,
                        ext4,
                        ext5,
                        ext6,
                        id,
                        initFlag,
                        isPollingGroup,
                        machineCPU,
                        machineDisk,
                        machineNetwork,
                        modifyType,
                        passwordUpdateTime,
                        pollingGroupId,
                        rangeOfAction,
                        resCode,
                        resMsg,
                        serialNumber,
                        updateDate,
                        updateOrg,
                        updateUser,
                        userClass,
                        userStatus,
                        userType,
                        whiteList,
                        orgTree,
                        remarks,cookie):
        data = {
        'createDate':createDate,
        'createUser':createUser,
        'creditName':creditName,
        'creditOrgCode':creditOrgCode,
        'creditPassword':creditPassword,
        'creditUser':creditUser,
        'deptCode':deptCode,
        'digitalCertificate':digitalCertificate,
        'ext1':ext1,
        'ext2':ext2,
        'ext3':ext3,
        'ext4':ext4,
        'ext5':ext5,
        'ext6':ext6,
        'id':id,
        'initFlag':initFlag,
        'isPollingGroup':isPollingGroup,
        'machineCPU':machineCPU,
        'machineDisk':machineDisk,
        'machineNetwork':machineNetwork,
        'modifyType':modifyType,
        'passwordUpdateTime':passwordUpdateTime,
        'pollingGroupId':pollingGroupId,
        'rangeOfAction':rangeOfAction,
        'resCode':resCode,
        'resMsg':resMsg,
        'serialNumber':serialNumber,
        'updateDate':updateDate,
        'updateOrg':updateOrg,
        'updateUser':updateUser,
        'userClass':userClass,
        'userStatus':userStatus,
        'userType':userType,
        'whiteList':whiteList,
        'orgTree':orgTree,
        'remarks':remarks
        }
        req = Request(ServerUrl.credit_per_update_url,data=data,headers=cookie)
        return req.post()


    @classmethod
    def per_del(cls,id,cookie):
        '''
        删除
        :param id:
        :param cookie:
        :return:
        '''
        data = {
            'id': id
        }
        req = Request(ServerUrl.credit_per_user_del_url,params=data,headers=cookie)
        return req.post()








if __name__ == "__main__":
    pass